Skip to content

Conversation

tpluscode
Copy link
Collaborator

@tpluscode tpluscode commented Sep 8, 2025

This PR implements the basic functionality of creating showcases with

  • translated content
  • cover image
  • tags, categories, type, url
  • validation
  • saving locally when working in dev environment

TODO are datasets and saving to GitHub

Unlike that in decap, the submission form is flat, with the translated fields suffixed as title-de, body-fr, etc. They are then expanded to the individual markdown files.

I use the same zod schema for validation and will return translated error messages to the client.

<span>
{{ option.title }}
<span style="float: right; color: #888;">({{ option.count }})</span>
<span v-if="option.count" style="float: right; color: #888;">({{ option.count }})</span>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hiding the ({count}) text when it's not set to avoid empty ()

#selected-option="option"
>
{{ option.title }}
<input type="hidden" :name="name" :value="option.id">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hidden input makes it possible to use the component in native <form>

</li>
<li v-if="item.subMenu" class="tab">
<v-menu>
<v-menu open-on-hover>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the menu to expand on hover so that Showcases in the menu is still a link but it also has child items in a submenu

@@ -0,0 +1,150 @@
<template>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is direct copy from swiss design

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input css is currently broken. There is a conflict with vuetify (which is not removed here but in main)

@@ -0,0 +1,49 @@
<template>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy from swiss design example plus...

Comment on lines +32 to +48
.notification-banner {
display: block;
transition-property: padding, opacity;
transition-timing-function: ease-in-out, ease-in-out;
}
.notification-banner:not([open]) {
padding: 0;
opacity: 0;
overflow: hidden;
}
.notification-banner__wrapper {
transition-property: height;
transition-duration: 0s;
}
.notification-banner:not([open]) .notification-banner__wrapper {
height: 0;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...a transition which smoothly collapses the notification when open is set from true to false

@@ -0,0 +1,109 @@
<template>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a copy from swiss design

}, (resource, localeInstance) => {
return {
...resource,
pref_label: resource.pref_label[localeInstance.currentLocale],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not figure out a way to use the Extended result so that translations are automatically selected

},
runtimeConfig: {
public: {
contentRoot: path.resolve(__dirname, 'content')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be used only locally to find the content dir in the repository.

@tpluscode tpluscode self-assigned this Sep 9, 2025
feat(showcase): select and upload showcase cover image
# Conflicts:
#	opendata.swiss/ui/nuxt.config.ts
Copy link

github-actions bot commented Sep 15, 2025

Your preview environment is deployed! 🚀
URL: https://showcase-form.piveau-ln-preview.zazukoians.org/
Note: It may take a few minutes for the DNS to propagate, the certificate to be generated and the preview to be reachable.

@tpluscode tpluscode marked this pull request as ready for review September 23, 2025 08:48
# Conflicts:
#	opendata.swiss/ui/app/components/headers/OdsHeader.vue
#	opendata.swiss/ui/i18n/locales/de.json
#	opendata.swiss/ui/i18n/locales/en.json
#	opendata.swiss/ui/i18n/locales/fr.json
#	opendata.swiss/ui/i18n/locales/it.json
Copy link
Collaborator

@BenjaminHofstetter BenjaminHofstetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the menu to expand on hover so that Showcases in the menu is still a link but it also has child items in a submenu

Now i got your problem. The new DropDownMenu is currently broken. @click.prevent is preventing the link action and the menu is never closing unless you click close. This is not good and the swiss style dropdown menu with this close button makes no sense if we open / close on hover. Do we need the "Submit Showcase" as a menu item or can we have a (+) add show case button on the showcase page?

@tpluscode
Copy link
Collaborator Author

Do we need the "Submit Showcase" as a menu item or can we have a (+) add show case button on the showcase page?

Quite likely, a button will be a better design. Since we don't really have a functional showcase listing, I will revert the menu and leave that for later

* feat(showcases): dataset search in form

* feat: saving dataset to submitted showcase

* feat: added datasets to showcase form

* revert: cosmetic changes
@tpluscode tpluscode merged commit 39891fc into main Oct 2, 2025
3 checks passed
@tpluscode tpluscode deleted the showcase-form branch October 2, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants